<?php
namespace app\common\validate;

use think\Validate;

class Permission extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'role_id' => 'require|number',
        'permission_id' => 'require|number',
        'name' => 'require|max:100',
        'description' => 'min:1|max:250',
        'page'  =>  'require|gt:0|number',
        'limit' =>  'require|gt:0|number',
        'is_expand' =>  'require|in:0,1',
        'type'=>'require|in:0,1,2,3'
    ];

    protected $scene = [
        'create' => ['name','node_url','p_id','type','is_expand','description'],
        'delete' => ['id'],
        'backendList'=>['page','limit'],
        'nodeList'=>['type'],
        'rolePermissionList'=>['role_id','page','limit'],
        'assignPermission'=>['role_id','permission_id'],
        'changeStatus'=>['id']
    ];
}
